import time

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By

path = Service('./chromedriver')
driver = webdriver.Chrome(service=path)
driver.get('https://cn.bing.com/')
# 定位搜索框
search_box = driver.find_element(By.ID, 'sb_form_q')
# 清除搜索框的内容
search_box.clear()
time.sleep(2)
# 在搜索框输入“中国”
search_box.send_keys("中国")
time.sleep(2)
# 定位「国际版」按钮
# <div id="est_en" class="est_common est_unselected">国际版</div>
button = driver.find_element(By.ID, 'est_en')
# 点击「国际版」
button.click()

time.sleep(2)
driver.quit()
